package com.xcm.cloud.controller;

import com.xcm.cloud.common.BaseController;
import com.xcm.cloud.common.ResultBean;
import com.xcm.cloud.bean.User;
import com.xcm.cloud.servface.UserServface;
import com.xcm.cloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/user")
public class UserController extends BaseController implements UserServface {
    @Autowired
    private UserService userService;

    @GetMapping
    @Override
    public ResultBean<List<User>> users(){
        return super.success(this.userService.allUsers());
    }
}
